class: center, middle, inverse, title-slide .title[ # Modelos de ocupación ] .subtitle[ ## Uniandes, 2023 ] .author[ ### Diego J. Lizcano, Ph.D. test ] .institute[ ### SCMAS, Destino Naturaleza (USAID) ] .date[ ### 2023-05-04 ] ---
Uso de Modelos de Ocupación en proyectos de conservación
Home
About
☰
background-image: url(data:image/png;base64,#https://uniandes.edu.co/sites/default/files/logo-uniandes.png) --- class: center, middle # Gracias a ## Aída Otálora-Ardila  --- class: inverse, center, middle # Get Started --- class: inverse, center # Diego J. Lizcano  -- Biólogo. Universidad de los Andes, Bogotá-Colombia. -- Ph.D. University of Kent, Canterbury, UK. -- Ecology and conservation of mammals (Tapirs). --- class: inverse, center, middle # Now You... --- # In this workshop: We are going to use  And strongly recommended to use  --- class: center, top, inverse # Ecology ### Charles Krebs  --- # Ecology: Study of interactions that determine **Distribution and Abundance** .left-column[  ] .right-column[ ### Distribution: Where are they. ### Abundance: How many?. ] -- Related to the problem of counting organisms! -- --- # Counting animals is not a trivial problem...  Animals move! --- ### As ecologist: The map of our dreams  #### at some point, we had to count the kangaroos --- # Conting Animals  #### Easy for animals that are conspicuous and that group together. --- # Conting Animals  #### Not so easy if they don't group. Capture - Mark - Recapture. Distance --- # Conting Animals  #### For some species it is cumbersome, impractical and very expensive. --- ### Relative abundance  #### An indicator variable of the state of the population I don't know how many there are, but I do know where there are more and where there are less. --- # However...  #### Animals move and hide (camouflage) --- class: center # Sampling is not infallible  Biologist are not super heroes. We make mistakes! #### Detectability and Imperfect detection concept --- # Detectability depends of -- ## 1. Sampling conditions (weather, time). -- ## 2. The ability of the observer (sensor). -- ## 3. The biology of the species being sampled. -- ### This error should be considered carefully to avoid bias in abundance estimates. --- # How the detection error occurs (Guillera‐Arroita 2016) see ppt  ##### It is an important error that must be considered in the sampling design!!! --- # Mackenzie et al 2002, 2003 to the rescue  unnoticed... --- # Book and presence program 2006 .left-column[  ] .right-column[  ] Mackenzie popularizes occupancy `\((\psi)\)` as a proxy of abundance taking into account detectability `\((p)\)` --- ## Allows you to set goals and to monitor them over time.  --- class: inverse, middle, center ## Occupancy # `$$\psi$$` ## Detection probability # `$$p$$` ### Occupancy is a reflection of other important population parameters such as density. --- ## 1. `\((\psi)\)` is the proportion of the sampled area that is occupied by the species. ## 2. By visiting the site several times I can be more sure that I detect the species when it is found in that place. ## 3. **Repeated sampling** are key. ## `\((\psi)\)` It is influenced by environmental variables (**Covariables**) such as vegetation cover, altitude, precipitation, etc. --- # This is what a data table with repeated sampling should look like | | visit1| visit2| visit3| visit4| |:-----|------:|------:|------:|------:| |site1 | 1| 0| 0| 1| |site2 | 0| 0| 0| 0| |site3 | 1| 1| 0| 0| |sitex | 0| 0| 0| 0| --- # Example calculating `\(\psi\)` and `\(p\)` ### Frequentist method (Maximum likelihood) .pull-left[ | | v 1| v 2| v 3| v 4| |:---|---:|---:|---:|---:| |s 1 | 1| 0| 0| 1| |s 2 | 0| 0| 0| 0| |s 3 | 1| 1| 0| 0| |s x | 0| 0| 0| 0| ] .pull-right[ | **Detection History** | |----------------------------------------| | `\(H_{1} \psi\)` × p1(1-p2)(1-p3)p4 | | `\(H_{2} \psi\)` × (1-p2)(1-p2)(1-p3)(1-p4)p4 | | `\(H_{3} \psi\)` × p1p2(1-p3)(1-p4) | | `\(H_{4} \psi\)` × (1-p2)(1-p2)(1-p3)(1-p4)p4 | ] ### Histories Combined in a Model: $$ `\begin{aligned} L(\psi, p \mid H_{1},...,H_{x}) = \prod_{i=1}^{x} Pr (H_{i}) \end{aligned}` $$ -- The model admits incorporating covariates to explain `\(\psi\)` and `\(p\)` -- --- # Same example calculating `\(\psi\)` and `\(p\)` ### Bayesian method .pull-left[ | | v 1| v 2| v 3| v 4| |:---|---:|---:|---:|---:| |s 1 | 1| 0| 0| 1| |s 2 | 0| 0| 0| 0| |s 3 | 1| 1| 0| 0| |s x | 0| 0| 0| 0| ] .pull-right[ It is important to understand that there are two processes that can be modeled hierarchically - The ecological process ($\psi$) follows a Bernoulli distribution. - The observation model ($p$) follows a Bernoulli distribution. The probability of observing the species given that it is present: `\(p = Pr(y_{i}=1 \mid z_{i}=1)\)` The Occupancy probability: `\(\psi =Pr(z_{i}=1)\)` ] --- ### A hierarchical (Bayesian) model  ### Admits Covariates --- ## Which one should I use? The maximum likelihood or Bayesian? .pull-left[ ML - Package [unmarked](https://cran.r-project.org/web/packages/unmarked/index.html) - In R - Admits "automatic" model selection AIC - Problems with many NAs - Hesian problem. estimates ok. - Difficulty from 1 to 10: 3 if you already know R. ] Bayesian .pull-right[ - BUGS or Stan language, called from R - Model selection is not that easy, BIC is not suitable - You don't have as many problems with many NAs in the matrix - Estimates are more accurate. - Difficulty from 1 to 10: 7 if you already know R. ] --- class: middle, center # Going Deep  ### Andy Royle (2008) Advanced level book with lots of details, formulas, examples and code in R and BUGS language. --- # Dragon-fly book (2015) .pull-left[  ] .pull-right[ ### More recent by [Marc Kery](http://store.elsevier.com/Marc-Kery/ELS_1059944/) More than 700 pages clearly explaining where the theory comes from, in a tutorial style, starting with a basic level of R to advanced models and their implementation in R and the BUGS language. ] --- background-image: url(data:image/png;base64,#img/baby-84626_1280.jpg) background-size: contain # Let's do it!  - R level? - Objects?, Vectors? - DataFrame? - Loops? - Functions? --- # Schedule .left-column[  ] .right-column[ | Day | Topic | |-----------------|------------------------------------------------------| | Tuesday 28 pm | Remembering R | | | [R as model tool](https://dlizcano.github.io/IntroOccuPresent/R_toModel_E.html) | | Wednesday 29 am | [Occupancy concept](https://dlizcano.github.io/IntroOccuPresent/modelOccuData_E.html) | | | Intro Occu Static model - [unmarked101](https://dlizcano.github.io/IntroOccuPresent/unmarked_101_E.html) | | Wednesday 29 pm | Static Model in deep I- [Sim Machalilla](https://dlizcano.github.io/occu_book/) | | | Static Model in deep II- [Data in unmarked](https://dlizcano.github.io/occu_book/unmarked.html) | | Thursday 30 am | Questions. Real World Data - [Deer](https://github.com/dlizcano/Mazama_rufina) | | | [More models](https://dlizcano.github.io/IntroOccuPresent/Otros_modelos_jerarquicos.html) | ] --- class: bottom, center background-image: url(data:image/png;base64,#img/children-593313_1280.jpg) background-size: cover # Thanks! Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan). Contact: Diego J. Lizcano <a href="http://twitter.com/dlizcano">
<a href="http://github.com/dlizcano">
--- ```r xfun::session_info('rmarkdown') ``` ``` ## R version 4.2.2 (2022-10-31 ucrt) ## Platform: x86_64-w64-mingw32/x64 (64-bit) ## Running under: Windows 10 x64 (build 14393) ## ## Locale: ## LC_COLLATE=Spanish_Colombia.1252 LC_CTYPE=Spanish_Colombia.1252 ## LC_MONETARY=Spanish_Colombia.1252 LC_NUMERIC=C ## LC_TIME=Spanish_Colombia.1252 ## ## Package version: ## base64enc_0.1.3 bslib_0.4.2 cachem_1.0.7 cli_3.6.0 ## digest_0.6.31 ellipsis_0.3.2 evaluate_0.20 fastmap_1.1.0 ## fontawesome_0.5.0 fs_1.6.1 glue_1.6.2 graphics_4.2.2 ## grDevices_4.2.2 highr_0.10 htmltools_0.5.4 jquerylib_0.1.4 ## jsonlite_1.8.4 knitr_1.42 lifecycle_1.0.3 magrittr_2.0.3 ## memoise_2.0.1 methods_4.2.2 mime_0.12 R6_2.5.1 ## rappdirs_0.3.3 rlang_1.1.0 rmarkdown_2.21 sass_0.4.5 ## stats_4.2.2 stringi_1.7.12 stringr_1.5.0 tinytex_0.44 ## tools_4.2.2 utils_4.2.2 vctrs_0.5.2 xfun_0.37 ## yaml_2.3.7 ## ## Pandoc version: 2.19.2 ```